<?php
$module = $CONFIG['modules'];
if (!$module) return '';
$c = Eleanor::$Cache->Get('first_page_left'. Language::$main . $module);
if ($c === false) {
	global $Eleanor;
	$qr = Eleanor::$Db->Query('
		SELECT `id`, `title_l`, `active`, `sections`, `path`
		FROM `'. P .'modules`
		WHERE `id` = "'. $module .'"
		LIMIT 1
	');
	$lang = Eleanor::$Language->load(Eleanor::$rootf .'langs/first_page_right-*.php');
	$a = $qr->fetch_assoc();
	$conf = include $Eleanor::FormatPath($a['path'] .'/config.php');

	if (isset($conf['t'], $conf['tl'])) {
		$m_data = $R = Eleanor::$Db->Query('
			SELECT `id`, `cats`, `uri`, `title`, `text`
			FROM `'. $conf['t'] .'`
			INNER JOIN `'. $conf['tl'] .'` USING(`id`)
			WHERE `language`IN(\'\', \''. Language::$main. '\') AND `lstatus` = 1
			ORDER BY `ldate` DESC
			LIMIT 3
		');
		$section_inf = unserialize($a['sections']);
		$section_name = Eleanor::FilterLangValues($section_inf[$conf['n']]);
		$section_name = $section_name[0];
		unset($section_inf);
		$i = 0;
		while($m = $m_data->fetch_assoc()) {
			$url = $Eleanor->Url->Construct(array('module' => $section_name) + $Eleanor->Categories->GetUri((int)ltrim($m['cats'],',')) + array('u' => array($m['uri'], 'nid' => $m['id'])), false, true, 1);
			$c .= '<article class="content_left_records"><a class="content_left_link_image" href="'. $url .'"><img src="'. Eleanor::GetTemplatePath() .'images/business_man.png" width="72" height="72" alt=""></a><a class="content_left_link_text" href="'. $url .'"><div class="content_left_upper content_left_text">'. $m['title'] .'</div><div class="content_left_lower content_left_text">'. Strings::CutStr(strip_tags($m['text']), 160) .'</div></a></article>'. ($i++ < 2 ? '<div class="content_left_border"></div>' : null);
		}
		$c .= '<div class="read_further_container"><a href="'. $Eleanor->Url->special . $Eleanor->Url->Construct(array('module' => $section_name), false) .'"><div class="read_further_image"></div><div class="read_further_text">'. $lang['read_more'] .'</div></a></div>';
	}
	Eleanor::$Cache->Put('first_page_left'. Language::$main . $module, $c);
}
return $c;